home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / oppopwin.zip / TEST.PAS < prev   
Pascal/Delphi Source File  |  1992-03-31  |  3KB  |  107 lines

  1. Program Test;
  2. Uses OpCrt,
  3.      OpFrame,
  4.      OpCmd,
  5.      OpString,
  6.      OpPopWin;
  7.  
  8. Var
  9.    MyMenu,
  10.    PrinterMenu : PopWindow;
  11.  
  12. Const
  13.      State   : Boolean = True;
  14.      Count   : Byte    = 6;
  15.  
  16.  
  17. {$I MYCOLOR.PAS}
  18.  
  19. Function OnOff(Input : Boolean) : String;
  20. Begin
  21.      If Input then
  22.         OnOff := ' On'
  23.      Else
  24.         OnOff := 'Off';
  25. End;
  26.  
  27.  
  28.  
  29. Begin
  30.      PopCommands.cpOptionsOn(cpEnableMouse);
  31.      If Not PrinterMenu.Init(5,10,50,17, 2, NormalColorSet) then
  32.         WriteLn('Error while trying to initialize pop window')
  33.      Else
  34.      Begin
  35.           With PrinterMenu do
  36.           Begin
  37.                WFrame.AddShadow(shBR,shSeeThru);
  38.                WFrame.SetFrameType(DefWindowFrame);
  39.                ppOptionsOn(ppCapitalize+ppAllowEsc);
  40.                AddHeaders('Spencer Steel Ltd.','Printer Menu');
  41.                AddTopic('Print a single Work Order',1);
  42.                AddTopic('Print a single Purchase Order',2);
  43.                AddTopic('Print inventory list',3);
  44.                AddTopic('Print WO''s on file',4);
  45.                AddTopic('Print PO''s on file',5);
  46.                AddTopic('Return to main menu',6);
  47.           End;
  48.      End;
  49.  
  50.      If Not MyMenu.Init(20,5,60,14, 2, NormalColorSet) then
  51.         WriteLn('Error while trying to initialize pop window')
  52.      Else
  53.      Begin
  54.  
  55.           With MyMenu do
  56.           Begin
  57.                WFrame.AddShadow(shBR,shSeeThru);
  58.                ppOptionsOn(ppUseLetters);
  59.                AddHeaders('Spencer Steel Ltd.','Functional Inventory');
  60.                AddTopic('Add/Edit Inventory',1);
  61.                AddTopic('Increase padding to '+Long2Str(Count),2);
  62.                AddTopic('Edit/Delete a Work Order',3);
  63.                AddTopic('Add a Purchase Order',4);
  64.                AddTopic('Edit/Delete a Purchase order',5);
  65.                AddTopic('Reports',6);
  66.                AddTopic('Current State '+OnOff(State),7);
  67.                AddTopic('Exit inventory sytem',8);
  68.           End;
  69.      End;
  70.  
  71.      FastFill(ScreenWidth*ScreenHeight,#176,1,1,$0F);
  72.      MyMenu.Draw;
  73.      Repeat
  74.            MyMenu.Process;
  75.            Case MyMenu.GetLastChoice of
  76.                 1 : ;
  77.                 2 : Begin
  78.                          MyMenu.SetPadLength(Count);
  79.                          Inc(Count);
  80.                          MyMenu.ChangeTopic(MyMenu.GetTopicNum(2),'Set Padding to '+Long2Str(Count),True);
  81.                     End;
  82.                 3 : ;
  83.                 4 : ;
  84.                 5 : ;
  85.                 6 : Begin
  86.                          PrinterMenu.Draw;
  87.                          Repeat
  88.                                PrinterMenu.Process;
  89.                          Until (PrinterMenu.MaxPicks = PrinterMenu.GetTopicNum(PrinterMenu.GetLastChoice)) or
  90.                                (PrinterMenu.GetLastCommand = ccQuit);
  91.                          PrinterMenu.Erase;
  92.                     End;
  93.               7   : Begin
  94.                          State := Not State;
  95.                          MyMenu.ChangeTopic(MyMenu.GetTopicNum(7),'Current State '+OnOff(State),True);
  96.                     End;
  97.            End;
  98.      Until MyMenu.MaxPicks  = MyMenu.GetLastChoice;
  99.      MyMenu.Done;
  100.      PrinterMenu.Done;
  101. End.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.